<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>

var s = "abc4 abd6 abe3 abf1 abg7";	// 字符串直接量
var r = /ab[c-g][1-7]/g; 
	// 匹配第一、二个字符为ab，第三个字符为从c到g，第四个字符为1~7的任意数字
var a = s.match(r); 
	// 返回数组["abc4"," abd6"," abe3"," abf1"," abg7"]



</script>
</body>
</html>
